﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace RayTracing
{

    class ParaTestScene : Scene
    {

        // Camera variables
        Camera camera = new Camera(Main.camera.pos, Main.camera.hpr);

        public Color backGroundColor;

        // Lights in Scene        
        public AmbientLight ambientLight;
        public DirectionalLight directionalLight;

        //Geometries
        Geometry para1;
        Geometry spara1;
        Geometry sphere1;
        Geometry sphere2;

        //Textures
        Texture uv;
        Texture green;
        Texture red;

        //Skins
        Skin nonreflective;
        Skin mirror;

        // Scene Objecets
        SceneObject greenSphere;
        SceneObject sphereObj;


        public override string sceneName()
        {
            return "Para Test";
        }

        public override void createScene(out List<SceneObject> objects, out List<Light> lights, out Camera camera, float time, float slider1, float slider2, float slider3, float slider4, float slider5)
        {

    
            // every scene needs these two lines
            objects = new List<SceneObject>();
            lights = new List<Light>();

            // Camera variables
            camera = new Camera(Main.camera.pos, Main.camera.hpr);
            backGroundColor = Color.BLACK;

            // Lights in Scene
            ambientLight = new AmbientLight(new Color(.4f, .4f, .4f));
            directionalLight = new DirectionalLight(new P3(1, 1, 1), new Color(1.8f, 1.8f, 1.8f));
            //add Lights to the lights lisc
            lights.Add(ambientLight);
            lights.Add(directionalLight);
            sphere2 = new Sphere(new P3(0,7,0), 1);
            sphere1 = new Sphere(new P3(0, 5, -1.5f), 1);
            RoundCone sharp = new RoundCone(true);

            Cube cube1 = new Cube();
            para1 = new Parabaloid(1, 1,-1, 0, 0, 0,0, 0, 0, 0);
            
            //geometries
           // para1 = new Parabaloid(1, slider1, slider2, slider3, time, slider4, 1, 3, 1, 3);
            ShiftedObject spara1 = new ShiftedObject(sharp);

           // spara1.scale(new P3(1+1/(slider4), 1,1+1/( slider5)));
            spara1.rotate(new P3(slider1/3,slider2/3,5+slider3/3));
            spara1.translate(new P3(0,-9f, 0));
            

            //new Sphere(new P3(0, 9, 0), 1);
           
            //textures
            uv = new ImageTexture(Properties.Resources.uvImage);
            green = new SolidTexture(Color.GREEN);
            red = new SolidTexture(Color.RED);
//skins
            nonreflective = new NonReflective();
            mirror = new Mirror();
            multiSkin nonPerfectMirror = new multiSkin(mirror, nonreflective);

            Texture[] texar = { uv, red };
            Skin[] skinar ={mirror,nonreflective};

            MultiRegionTexture multi = new MultiRegionTexture(texar);
            
            // Scene Objects
            greenSphere = new SceneObject(spara1,multi,nonreflective);
           sphereObj = new SceneObject(sphere1, red, nonreflective);

          
            //add objects to theScene
           objects.Add(greenSphere);
           //objects.Add(sphereObj);


         


        }

        public override String[] SliderLabels()
        {
            String[] sliderLabels = { "Dlight X", "Dlight Z", "Dlight Y", "Not Used", "Not Used" };
            return sliderLabels;
        }

        public override AnimationParamaters getAnimationParamaters()
        {
            return new AnimationParamaters(21, 1);
        }
    }
}
